package com.nineclock.sign.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nineclock.sign.pojo.SignInfoCount;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SignInfoCountMapper extends BaseMapper<SignInfoCount> {

    @Select("select create_date ,count(*) as count from sign_info where company_user_id = #{id} GROUP BY create_date")
    List<SignInfoCount> queryCount(Long id);

    @Select("SELECT * FROM `sign_info` where company_id  = #{companyId} and create_date BETWEEN #{startTime} and #{endTime}")
    List<SignInfoCount> queryUserCount(@Param("startTime") String startTime,
                                       @Param("endTime") String endTime,
                                       @Param("companyId") Long companyId);
}
